package com.lobo.blog.mappers;

import com.lobo.blog.entity.Comment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * className: CommentMapper<br/>
 * author: MacieSerenity <br/>
 * date: 2022-10-14 17:23
 **/
@Mapper
public interface CommentMapper {

    List<Comment> findCommentListByBlogId(@Param("blogId") Integer blogId);

    Comment findSingleCommentByCommentId(@Param("id") Integer id);

    Integer saveComment(@Param("comment") Comment comment);
    Comment findCommentById(@Param("id")Integer id);
    List<Comment> findCommentByParentId(@Param("parentId")Integer parentId);
    List<Comment> findByBlogIdAndParentCommentNull(@Param("blogId")Integer blogId);

}
